// part1:C09:ex9.21.cpp
// use insert method tto add elements to vector.
#include <iostream>
#include <vector>

int main(void) {
  using namespace std;
  vector<string> vec;
  string word;
  auto iter = vec.begin();
  while (cin >> word) {
    iter = vec.insert(iter, word);
  }

  for (auto iter = vec.cbegin(); iter != vec.cend(); ++iter) {
    cout << *iter << endl; 
  }

  return 0;
}
